import { Entity, PrimaryGeneratedColumn, ManyToOne, OneToMany } from 'typeorm'
import { Shop } from './shop.entity'
import { ShopRoleRight } from './shop-role-right.entity'

@Entity()
export class ShopRole {
  @PrimaryGeneratedColumn()
  id: number

  @ManyToOne(type => Shop, shop => shop.roles)
  shop: Shop

  @OneToMany(type => ShopRoleRight, roleRight => roleRight.role)
  rights: ShopRoleRight[]
}
